package com.pengtu.gsj.dao.lzgl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.pengtu.gsj.dao.hibernate.HibernateDao;
import com.pengtu.gsj.entity.lzgl.InPorMat;

@Repository
public class InPorMatDao extends HibernateDao<InPorMat, String> {

	public List<InPorMat> findInPorMatByItem(String startTime, String endTime, String proSupContent) {
		String hql = "select new com.pengtu.gsj.entity.lzgl.InPorMat("
				+ " t.year,"
				+ " t.orgName,"
				+ " t.inPorMat,"
				+ " sum(t.checkNum),"
				+ " t.ifChecknote,"
				+ " t.ifTimeRect)"
				+ " from InPorMat t"
				+ " where t.inPorMat = ? and t.delFlag = 0 and t.year >= ? and t.year <= ?"
				+ " group by t.year, t.inPorMat, t.orgName, t.ifChecknote, t.ifTimeRect"
				+ " order by t.year ASC";
		return find(hql, proSupContent, startTime, endTime);
	}

	public List<InPorMat> getInPorMat(String startTime, String endTime) {
		String hql = "select new com.pengtu.gsj.entity.lzgl.InPorMat("
				+ " t.inPorMat)"
				+ " from InPorMat t"
				+ " where t.delFlag = 0"
				+ " group by t.inPorMat";
		return find(hql);
	}
}
